<?php


namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * 积分日志
 * Class IntegralSet
 * @package App\Models
 */
class IntegralLog extends Model
{
    protected $fillable = [
        'integral_set_id', 'user_id', 'openid', 'integral', 'before_integral',
        'after_integral', 'created_at', 'updated_at'
    ];
    protected $table = 'estate_Integral_log';


    /**
     * 2021/3/15--22:57
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     * @author:董宗澳
     * @email:2453611300
     * @wechat:DZA74941
     * @QQ:2453611300
     * @web:www.quzha.net
     * @method:order
     * @effect:获取订单信息
     */
    public function order()
    {
        return $this->hasMany('App\Models\Order', 'id', 'form_order_id');
    }

    /**
     * 2021/3/15--22:56
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     * @author:董宗澳
     * @email:2453611300
     * @wechat:DZA74941
     * @QQ:2453611300
     * @web:www.quzha.net
     * @method:order_goods
     * @effect:获取订单商品信息
     */
    public function order_goods()
    {
        return $this->hasMany('App\Models\OrderGoods', 'order_id', 'form_order_id');
    }

    /**
     * 2021/3/15--22:56
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     * @author:董宗澳
     * @email:2453611300
     * @wechat:DZA74941
     * @QQ:2453611300
     * @web:www.quzha.net
     * @method:store
     * @effect:获取店铺信息
     */
    public function store()
    {
        return $this->hasOne('App\Models\Store', 'id', 'store_id');
    }

    /**
     * 2021/3/15--22:57
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     * @author:董宗澳
     * @email:2453611300
     * @wechat:DZA74941
     * @QQ:2453611300
     * @web:www.quzha.net
     * @method:user
     * @effect:获取用户信息
     */
    public function user()
    {
        return $this->hasOne('App\Models\User', 'id', 'user_id');
    }
}
